import request from '../utils/request.js'
export const getUserChannelsAPI = function () {
  return request.get('/v1_0/user/channels')
}
export const getArtListAPI = function (id, time) {
  return request.get('/v1_0/articles', {
    params: {
      channel_id: id,
      timestamp: time
    }
  })
}
export const dislikeArticleAPI = id => {
  return request.post('/v1_0/article/dislikes', {
    target: id
  })
}
export const reportArticleAPI = function (target, type) {
  return request.post('/v1_0/article/reports', {
    target,
    type
  })
}
// 获取所有频道数据的 API
export const getAllChannelAPI = () => {
  return request.get('/v1_0/channels')
}
export const updateUserChannelAPI = function (channels) {
  return request.put('/v1_0/user/channels', { channels })
}
